-module (tut5).
-export ([format_temps/1]).

format_temps([]) ->
	ok;
format_temps([City | Rest]) ->
	print_temp(conver_to_celsius(City)),
	format_temps(Rest).

conver_to_celsius({Name, {c, Temp}})->
	{Name, {c, Temp}};
conver_to_celsius({Name, {f, Temp}})->
	{Name, {c, (Temp-32)*5/9}}.
print_temp({Name, {c, Temp}}) ->
	io:format("~-15w ~w c~n", [Name, Temp]).